CFLAGS = -Wall -fpic -coverage -lm -std=c99

default: randomtestcard.out randomtestadventurer.out

randomtestcard.out: randomtestcard.c dominion.o
	rm -f randomtestcard.out
	echo "Result for running randomtestcard.c tests:" >> randomtestcard.out
	
	gcc -o randomtestcard -g randomtestcard.c dominion/dominion.c $(CFLAGS)
	./randomtestcard >> randomtestcard.out

	echo “gcov results:” >> randomtestcard.out

	gcov -b dominion.c >> randomtestcard.out

randomtestadventurer.out: randomtestadventurer.c dominion.o
	rm -f randomtestadventurer.out
	echo "Result for running randomtestadventurer.c tests:" >> randomtestadventurer.out
	
	gcc -o randomtestadventurer -g randomtestadventurer.c dominion.c $(CFLAGS)
	./randomtestadventurer >> randomtestadventurer.out

	echo “gcov results:” >> randomtestadventurer.out

	gcov -b dominion.c >> randomtestadventurer.out

dominion.o: dominion.h dominion.c rngs.o
	gcc -c dominion.c -g  $(CFLAGS)

rngs.o: rngs.h rngs.c
	gcc -c rngs.c -g  $(CFLAGS)
	
clean:
	rm -f randomtestadventurer.out

cleanall: 
	rm -f randomtestadventurer.out randomtestcard.out randomtestadventurer randomtestcard *.gcda *.gcno *.gcov
